package prova;

public class MyClass {
	private int i;

	public MyClass() {
		i = 0;
	}

	public synchronized void increment() {
		i++;
	}

	public synchronized void decrement() {
		if (i == 0) {
			i = 23;
		} else {
			i--;
		}
	}

	public int getCurrentValue() {
		return i;
	}
}
